package com.hdu.kdk_feign.controller;

import com.hdu.User;
import com.hdu.kdk_feign.feignClients.UserClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test")
public class TestController {

    final
    UserClient userClient;

    public TestController(UserClient userClient) {
        this.userClient = userClient;
    }

    @GetMapping("getUserById")
    public User getUserById(@RequestParam long id) {
        return userClient.getUserById(id);
    }
}
